using System;
using System.Collections.Generic;
using System.Text;

namespace Hoshimi
{
    public class AZNShooterGroup_ManageState : State
	{
		#region Singleton

		// Fields
		protected static AZNShooterGroup_ManageState instance;

		// Constructor
		protected AZNShooterGroup_ManageState() : base() { }

		// Methods
		public static AZNShooterGroup_ManageState Instance()
		{
			// Uses "Lazy initialization"
			if( instance == null ) 
				instance = new AZNShooterGroup_ManageState();

			return instance;
		}

		#endregion

		public override bool Play( Unit unit )
		{
			AZNShooterGroup group = (AZNShooterGroup) unit;

			group.UpdateAZNPointToProtect();

			group.AskRequireBot();

			if(!group.IsPierreNanoAIDead)
			{
				return true;
			}

			group.myStateMachine.ChangeState( AZNShooterGroup_ReleaseState.Instance() );
			return false;
		}
	}
}
